<template>

</template>

<script setup lang="ts">
import useStore from "@/store";
import { debouncedWatch } from "@vueuse/core";
import {searchRecord} from "@/api/record";
import {RecordSearch} from "@/api/record/types";
const { app } = useStore();

const keyword = ref("");
const articleList = ref<RecordSearch[]>([]);
debouncedWatch(
  keyword,
  () => keyword.value ? handleSearch() : articleList.value = [],
  { debounce: 300 },
);
const handleSearch = () => {
  searchRecord(keyword.value).then(({ data }) => {
    articleList.value = data.data;
  })
}
</script>

<style scoped>

</style>